<script>
  const endpoint = 'https://jsonplaceholder.typicode.com/users'
  const fetchUsers = async () => {
    try {
      const response = await fetch(endpoint)
      if (!response.ok) throw new Error('Network response was not ok')
      const data = await response.json()
      console.log(data)
    } catch (error) {
      console.error('error:', error)
    }
  }
  fetchUsers()
</script>
